package org.learn.test;

public class Mu1ForExercise03 {
    public static void main(String[] args) {
        int s = 7;//s表示层数需求
        for(int i = 1; i <= s; i++){
            for(int k = 1; k <= s - i;k++){
                //控制打印每层空格的个数
                System.out.print(" ");
            }
            //i表示层数
            for(int j = 1; j <= 2 * i - 1; j++){
                //控制打印每层*的个数
                if(j == 1 || j == 2 * i - 1 || i == s) {
                    System.out.print("*");
                }else{
                    System.out.print(" ");
                }
            }
            System.out.print("\n");
        }
    }
}
